<?php
/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
require_once 'include/base.php';
require_once 'include/topwrap.php';
require_once 'include/class.rss.php';
$top_config = Taoapi_Config::Init();
$top_config->setCharset('utf-8');

$taoapi = new TopWrap(false, true);

$category = !empty($_GET['catid']) ? $_GET['catid'] : '16';

$items = $taoapi->getItems($category, 1, 40);

$cates = $taoapi->getItemCat($category);

$title = $cates['item_cats']['item_cat']['name'];

$url   = "http://www.itaohome.com";

$rss = new RSS($title, $url, "爱淘之家商品信息");

$items = $items['taobaoke_items']['taobaoke_item'];

foreach($items as $row) {
    $tmpurl = $url . '/item-'.$row['num_iid'];
    $description = '<center><p>' . $row['title'].'</p><p><img src="'.$row['pic_url'].'" /></p><p>价格：'.$row['price'].'</p></center>';

    $rss->AddItem($row['title'], $tmpurl, $description,date('Y-m-d H:i:s',time()));
}
$rss->Display();
?>
